<?php

namespace app\api\model\questions;

use app\api\model\Models;
use think\db\Query;

class Opt extends Models
{
    /*
     * 定义全局的查询范围
     * @var array
     */
    protected $globalScope = ['order'];

    /**
     * 根据序列排序
     * @param Query $query
     * @param int $type
     * @return void
     */
    public function scopeOrder( Query $query )
    {
        $query->order('sequence', 'asc');
    }
}
